Jsonnet

Any file matching *.jsonnet in a directory app is treated as a Jsonnet file. ArgoCD evaluates the Jsonnet and is able to parse a generated object or array.

Build Environment

Jsonnet apps have access to the standard build environment via substitution into TLAs and external variables. It is also possible to add a shared library (e.g. vendor folder) relative to the repository root.

E.g. via the CLI:

  1. argocd app create APPNAME \
  2. --jsonnet-ext-var-str 'app=${ARGOCD_APP_NAME}' \
  3. --jsonnet-tla-str 'ns=${ARGOCD_APP_NAMESPACE}' \
  4. --jsonnet-libs 'vendor'

Or by declarative syntax:

  1. directory:
  2. jsonnet:
  3. extVars:
  4. - name: app
  5. value: $ARGOCD_APP_NAME
  6. tlas:
  7. - name: ns
  8. value: $ARGOCD_APP_NAMESPACE
  9. libs:
  10. - vendor